package com.irdstudio.apicenter.gateway.core.log;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.irdstudio.apicenter.gateway.core.dm.AppTradeLog;
import com.irdstudio.apicenter.gateway.core.jdbc.MaccsBaseDAO;
import com.irdstudio.apicenter.gateway.util.spring.BeanUtils;

/**
 * MACCS系统日志执行者
 * 
 * @author guangming.li
 * @version 1.0
 * @date 2015-05-25
 * 
 * @modify by ZhangHao 
 * @date 2015-6-19
 * <p>该类中使用的对象纳入Spring bean 管理
 * 
 */
public class MaccsLogExecutor {

	private final static Logger logger = LoggerFactory.getLogger(MaccsLogExecutor.class);

	/**
	 * 记录交易调用日志
	 * @param atl
	 */
	public static void writeTradeCalledLog(AppTradeLog atl) {

		try {

			MaccsBaseDAO baseDAO = BeanUtils.getBean(MaccsBaseDAO.class);
			baseDAO.insertBean(atl);

		} catch (Exception e) {
			logger.error("记录日志错误", e);
		} finally {
		}
	}
}
